<?php
/**
 * Student form
 *
 * @version $Id: Student.php 73 2010-04-25 00:30:44Z yingkuang.chen@gmail.com $
 * @license New BSD License
 * @uses Zend_Form
 * @package student
 * @subpackage Form
 */
class Student_Form_Student extends Sfs_Form
{
    protected $_arrayData;
    function __construct($options=null){
        $locale = Bootstrap::$config['resources']['locale']['default'];
        $path = dirname(__FILE__)."/../languages/$locale/data.ini";
        $ini = new Zend_Config_Ini($path);
        $this->_arrayData = $ini->get('array_data')->toArray();

        parent::__construct($options);
    }
    /**
     * initialization routine
     *
     * @return void
     */
    public function init()
    {
        $this->setMethod('post');

        $this->addElement('text', 'sn', array(
          'label'      => 'sn',
        //'required'   => true,
          'filters'    => array('StringTrim'),
        //  'validators' => array()
        )
        );
        $this ->addElement('text','student_id',array(
          'label'=>'student_id',
          'required'   => true,
          'filters'    => array('StringTrim','StripTags'),
         'size'=>5,
        ));
        $this->addElement('text', 'name', array(
          'label'      => 'name',
          'required'   => true,
          'filters'    => array('StringTrim','StripTags'),
      'validators' => array('NotEmpty'),
          'size' => 8
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'english_name', array(
          'label'      => 'english_name',
        //'required'   => true,
          'filters'    => array('StringTrim','StripTags'),
      'validators' => array('NotEmpty'),
          'size' => 8
        )
        );
        $this->addElement('radio', 'sex', array(
          'label'      => 'sex',
          'required'   => true,
          'filters'    => array('StringTrim'),
          'multiOPtions' => $this->_arrayData['sex'],
          'separator'=>'&nbsp;'
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'birthday', array(
          'label'      => 'birthday',
          'required'   => true,
          'filters'    => array('StringTrim'),
          'size' => 8,
        'validators' => array('date')

        )
        );
        $this->addElement('select', 'blood', array(
          'label'      => 'blood',
        //'required'   => true,
          'filters'    => array('StringTrim'),
          'multiOptions'=>array("","A","B","O","AB"),
        //  'validators' => array()
        )
        );

        $this->addElement('text', 'kind_memo', array(
          'label'      => 'kind_memo',
          'filters'    => array('StringTrim','StripTags'),
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'indigene_area', array(
          'label'      => 'indigene_area',
          'filters'    => array('StringTrim','StripTags'),
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'indigene_clan', array(
          'label'      => 'indigene_clan',
          'filters'    => array('StringTrim'),
            'size' => 10
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'nationality', array(
          'label'      => 'nationality',
          //'required'   => true,
          'filters'    => array('StringTrim'),
         'size' => 10,
        //  'validators' => array()
        )
        );
        $this->addElement('select', 'identification', array(
          'label'      => 'identification',
          'required'   => true,
          'filters'    => array('StringTrim'),
          'validators' => array('int'),
          'multiOptions'=> $this->_arrayData['identification'],
        )
        );
        $this->addElement('text', 'identification_number', array(
          'label'      => 'identification_number',
          'required'   => true,
          'filters'    => array('StringTrim','StripTags'),
          'size' =>  10 ,

        )
        );
        $this->addElement('text', 'colony', array(
          'label'      => 'colony',
          'filters'    => array('StringTrim'),
          'size' =>  10
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_address', array(
          'label'      => 'registered_address',
        'required'   => true,
          'filters'    => array('StringTrim','StripTags'),
          'size' => 36
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'address', array(
          'label'      => 'address',
          'required'=>true,
      'filters'    => array('StringTrim','StripTags'),
          'size' => 36
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'address_zip', array(
          'label'      => 'address_zip',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 6
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_county', array(
          'label'      => 'registered_county',
      'filters'    => array('StringTrim','StripTags'),
          'size' => 6
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_town', array(
          'label'      => 'registered_town',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 6
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_village', array(
          'label'      => 'registered_village',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 6
        )
        );
        $this->addElement('text', 'registered_neighbor', array(
          'label'      => 'registered_neighbor',
      'filters'    => array('StringTrim','StripTags'),
          'size' => 6
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_road', array(
          'label'      => 'registered_road',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 6
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_section', array(
          'label'      => 'registered_section',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 5
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_lane', array(
          'label'      => 'registered_lane',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 5
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_alley', array(
          'label'      => 'registered_alley',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 5
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_no', array(
          'label'      => 'registered_no',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 5
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_extend', array(
          'label'      => 'registered_extend',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 5
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_floor', array(
          'label'      => 'registered_floor',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 5
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_floor_extend', array(
          'label'      => 'registered_floor_extend',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 5
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'registered_other', array(
          'label'      => 'registered_other',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 5
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'phone_home', array(
          'label'      => 'phone_home',
          'required' => true,
          'filters'    => array('StringTrim','StripTags'),
          'size' => 10
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'phone_registered', array(
          'label'      => 'phone_registered',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 10
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'phone_mobile', array(
          'label'      => 'phone_mobile',
          'filters'    => array('StringTrim','StripTags'),
          'size' => 10
        //  'validators' => array()
        )
        );
        $this->addElement('select', 'class_property', array(
          'label'      => 'class_property',
          'required'   => true,
          'filters'    => array('StringTrim','StripTags'),
         'multiOptions'=> $this->_arrayData['class_property'],
        //  'validators' => array()
        )
        );

        $system_text = new Default_Model_SystemText();

        $this->addElement('select', 'special_kind', array(
          'label'      => 'special_kind',
          'filters'    => array('StringTrim','StripTags'),
            'multiOptions'=> $system_text->getKindArray('spe_class_kind',Default_Model_SystemText::HAS_EMPTY_OPTION),
        //  'validators' => array()stud_spe_kind
        )
        );
        $this->addElement('select', 'special_class_kind', array(
          'label'      => 'special_class_kind',
          'filters'    => array('StringTrim','StripTags'),
            'multiOptions'=> $system_text->getKindArray('stud_spe_kind',Default_Model_SystemText::HAS_EMPTY_OPTION),
        //  'validators' => array()
        )
        );
        $this->addElement('select', 'special_class_property', array(
          'label'      => 'special_class_property',
          'filters'    => array('StringTrim','StripTags'),
         'multiOptions'=> array_merge(array(""),$this->_arrayData['special_class_property']),

        //  'validators' => array()
        )
        );
        $this->addElement('select', 'preschool_qualification', array(
          'label'      => 'preschool_qualification',
          'filters'    => array('StringTrim','StripTags'),
        'multiOptions'=> array_merge(array(""),$this->_arrayData['preschool_qualification']),

        //  'validators' => array()
        )
        );
        $this->addElement('text', 'preschool_educational_id', array(
          'label'      => 'preschool_educational_id',
          'filters'    => array('StringTrim','StripTags'),
           'size' =>10
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'preschool_name', array(
          'label'      => 'preschool_name',
          'filters'    => array('StringTrim','StripTags'),
         'size' =>10
        //  'validators' => array()
        )
        );
        $this->addElement('select', 'elementary_school_qualification', array(
          'label'      => 'elementary_school_qualification',
          'filters'    => array('StringTrim','StripTags'),
        'multiOptions'=> array_merge(array(""),$this->_arrayData['elementary_school_qualification']),
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'elementary_school_educational_id', array(
          'label'      => 'elementary_school_educational_id',
           'filters'    => array('StringTrim','StripTags'),
        'size' =>10
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'elementary_school_name', array(
          'label'      => 'elementary_school_name',
          'filters'    => array('StringTrim','StripTags'),
        'size' =>10
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'enroll_year', array(
          'label'      => 'enroll_year',
          'filters'    => array('StringTrim','StripTags'),
           'size' => 3,
            'validators' => array('int'),
        )
        );
        $this->addElement('text', 'enroll_school', array(
          'label'      => 'enroll_school',
          'filters'    => array('StringTrim','StripTags'),
          'size' =>10
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'address_move_in', array(
          'label'      => 'address_move_in',
          'filters'    => array('StringTrim','StripTags'),
           'size' => 10,
        'validators' => array('date'
            //  array('regex', false, array('pattern' => '/^[0-9]{4}-[0-9]{2}-[0-9]{2}/i',
   			//	'messages' => array( Zend_Validate_Regex::NOT_MATCH => "'%value%' does not fit given date format")
             // ))
            ),

        )
        );
        $this->addElement('select', 'born_place', array(
          'label'      => 'born_place',
          'filters'    => array('StringTrim','StripTags'),
             'multiOptions'=> $system_text->getKindArray('birth_state',Default_Model_SystemText::HAS_EMPTY_OPTION),

        //  'validators' => array()
        )
        );

        $this->addElement('text', 'update_sn', array(
          'label'      => 'update_sn',
        //  'required'   => true,
          'filters'    => array('StringTrim','StripTags'),
        //  'validators' => array()
        )
        );
        $this->addElement('text', 'study_condition', array(
          'label'      => 'study_condition',
        //  'required'   => true,
          'filters'    => array('StringTrim','StripTags'),
        //  'validators' => array()
        )
        );

    }


}
